<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"
%>
<!DOCTYPE HTML>
<html>
  <head>
     <title>
	</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<script type="text/javascript">
</script>
<style>
body,div,html{
padding:0;margin:0;
}
a{
text-decoration:none;
}
#nexta{
display:block;font-weight:600;
}
.commdiv:hover{
background:#EAEAEA;
}
</style>
<body style="width:185px;min-height:300px;">
   	<div style="width:185px;min-height:300px;text-align: center;">
		<span style="color:red;font-size:18px;font-weight:600;">秒杀商品</span>
		<div style="height:473px">
		<c:if test="${slist!=null}">
			<c:forEach items="${slist}" var="seckill">
			<a href="${pageContext.request.contextPath}/seckill/jsp/${seckill.id}.jsp" target="_blank">
			<div style="width:165px;min-height:210px;border:1px solid #aaa;margin:10px 8px" class="commdiv">
			<div style="margin-top: 5px">
				<img src="${pageContext.request.contextPath}/file/img/${seckill.img}" style="width:120px;height:120px;border:1px solid red;">
			</div>
			<div>
				<span style="color:#6959CD;font-size:12px">${seckill.title}</span>
			</div>
			<div>
				<span style="color:red;font-size:13px">
				限时秒杀价:${seckill.price}元
				</span>
			</div>
			<div>
			<span style="color:red;font-size:12px;font-weight:600">
			<fmt:formatDate value="${seckill.sdate}" pattern="MM月dd日 HH时mm分"/>开始抢购
			</span>
			</div>
		</div>
		</a>
			</c:forEach>
		</c:if>
			<c:if test="${slist==null}">
			<h4>没有更多!</h4>
			</c:if>
		</div>
		<c:if test="${slist==null}">
		<a id="nexta" href="${pageContext.request.contextPath}/SeckillController/list.action?page=0">
		换一批</a>
		</c:if>
		<c:if test="${slist!=null}">
		<a id="nexta" href="${pageContext.request.contextPath}/SeckillController/list.action?page=${page+1}" >
		换一批</a>
		</c:if>
		</div>
 </body>
</html>